
//     if u_count == 0:
//         print("NO")
//     elif n % 2 == 1:
//         print("YES" if u_count != 2 else "NO")
//     else:
//         print("YES" if u_count % 2 == 1 else "NO")

#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false), cin.tie(nullptr);
    int t;
    cin >> t;
    while(t--){
        int n;
        cin >> n;
        string s;
        cin >> s;
        int uc = 0, 
        for(int i = 0; i < n; ++i){
            if(s[i] == 'U') uc++;
        }
        if(uc == 0) cout << "NO" << '\n';
        else if(n % 2 == 1){
            if(uc != 2) cout << "YES" << '\n';
            else cout << "NO" << '\n';
        }else{
            if(uc % 2 == 1) cout << "YES" << '\n';
            else cout << "NO" << '\n';
        }
    }

    return 0;
}